import {createRouter, createWebHistory} from "vue-router";

const router = createRouter({
    history: createWebHistory(),
    routes: [{
        path: '/',
        name: 'layout',
        redirect: '/login',
        component: () => import('@/views/Layout/LayoutView.vue'),
        children: [
            {
                path: 'home',
                name: 'home',
                component: () => import('@/views/Home/HomeView.vue')
            },
            {
                path: 'cart',
                name: 'cart',
                component: () => import('@/views/Cart/CartView.vue')
            },
            {
                path: 'order',
                name: 'order',
                component: () => import('@/views/Order/OrderView.vue')
            },
            {
                path: 'my',
                name: 'my',
                component: () => import('@/views/My/MyView.vue')
            }
        ]
    }, {
        path: '/shop/:id',
        name: 'shop',
        component: () => import('@/views/Shop/ShopView.vue')
    }, {
        path: '/address',
        name: 'address',
        component: () => import('@/views/Address/AddressView.vue')
    }, {
        path: '/address/create',
        name: 'createAddress',
        component: () => import('@/views/Address/CreateAddressView.vue')
    }, {
        path: '/login',
        name: 'LoginView',
        component: () => import('@/views/Login/LoginView.vue')
    }, {
        path: '/register',
        name: 'RegisterView',
        component: () => import('@/views/Login/RegisterView.vue'),
    },{
        path:'/orderConfirmation',
        name:'orderConfirmation',
        component:()=>import('@/views/Order/OrderConfirmationView.vue')
    }]
});

export default router;